<%@page language="java" contentType="text/html;chartset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head><title>insert title here</title></head>
<script>
    function add(){
        window.location.href="toAddDraw";
    }
    function returnPage(){
        window.location.href="index";
    }
    function del(id){
        if(confirm("确认删除吗?")){
            window.location.href="delDraw?id="+id;
        }
    }
</script>
<body>
<div>奖品列表</div>
<TABLE border="1" cellspacing="0" cellpadding="5">
    <TR>
        <TD>奖项</TD>
        <td>奖品</td>
        <td>数量</td>
        <td>操作</td>
    </TR>
    <c:forEach items="${list}" var="draw" varStatus="vs">
    <TR>
        <td>${draw.drawName}</td>
        <td>${draw.prizeName}</td>
        <td>${draw.prizeNum}</td>
        <td><a href="toEditDraw?id=${draw.id}">编辑</a> <a href="javascript:del(${draw.id})">删除</a></td>
    </TR>
    </c:forEach>
</TABLE>
<div><br/><button onclick="add()">新增</button> <button onclick="returnPage()">返回</button>

</div>
</body>
</html>